import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './views/Login.vue'
import wd from './components/wd.vue'
import Attence from './components/kq/Attence'
import AttenceExcList from './components/kq/AttenceExcList'
import ExcDetail from './components/kq/ExcDetail'
import ExcAdd from './components/kq/ExcAdd'
import ExcEdit from './components/kq/ExcEdit'
import Hygiene from './components/ws/Hygiene'
import HygieneDetail from './components/ws/HygieneDetail'
import HygieneAdd from './components/ws/HygieneAdd'
import HygieneEdit from './components/ws/HygieneEdit'
import Leave from './components/qj/Leave'
import LeaveDetail from './components/qj/LeaveDetail'
import TeaApply from './components/qj/TeaApply'


Vue.use(Router)

// const router =
export default new Router({
    routes: [{
        path: '/',
        redirect: '/login',
    }, {
        path: '/login',
        name: '/login',
        component: Login
    }, {
        path: '/home',
        name: 'home',
        component: Home
    }, {
        path: '/wd',
        name: 'wd',
        component: wd
    }, {
        path: '/Attence',
        name: 'Attence',
        component: Attence
    }, {
        path: '/AttenceExcList',
        name: 'AttenceExcList',
        component: AttenceExcList
    }, {
        path: '/ExcDetail',
        name: 'ExcDetail',
        component: ExcDetail
    }, {
        path: '/ExcAdd',
        name: 'ExcAdd',
        component: ExcAdd
    }, {
        path: '/ExcEdit',
        name: 'ExcEdit',
        component: ExcEdit
    }, {
        path: '/Hygiene',
        name: 'Hygiene',
        component: Hygiene
    }, {
        path: '/HygieneDetail',
        name: 'HygieneDetail',
        component: HygieneDetail
    }, {
        path: '/HygieneAdd',
        name: 'HygieneAdd',
        component: HygieneAdd
    }, {
        path: '/HygieneEdit',
        name: 'HygieneEdit',
        component: HygieneEdit
    }, {
        path: '/Leave',
        name: 'Leave',
        component: Leave
    }, {
        path: '/TeaApply',
        name: 'TeaApply',
        component: TeaApply
    }, {
        path: '/LeaveDetail',
        name: 'LeaveDetail',
        component: LeaveDetail
    }]
})

// //挂载路由导航守卫
// router.beforeEach(function(to, from, next) {
//     /* 必须调用 `next` */
//     if ('/login' == to.path || "/Login" == to.path) {
//         store.commit("set_isShowBar", false);
//     } else {
//         store.commit("set_isShowBar", true);
//     }
//     if (null == sessionStorage.getItem("set_token")) {
//         if (to.path !== "/Login") {
//             return next("/Login")
//         }
//     }
//     next()
// })

// export default router